/*
day447 
2020.11.17 
*/
#include<iostream>
#include<vector>
#include<cmath>
using namespace std;

 
class Solution {
public:
    int numPrimeArrangements(int n) {
		int count=0;
		for(int i=2;i<=n;++i)
		{
			if(isPrime(i))
			{
				count++;
			}
		}
		int mod=1e9 + 7;
		return (jiecheng(count)*jiecheng(n-count))%mod;
    }
    
    int jiecheng(int n)
	{
		int res=1,mod=1e9 + 7 ;
		for(int i=2;i<=n;++i)
		{
			res*=i;
			res%=mod;
		}
		cout<<res<<endl;
		return res;
	 } 
    
    bool isPrime(int n)
    {
    	int max=pow(n,0.5)+1;
    	for(int i=2;i<max;++i)
    	{
    		if(n%i==0) return false;
		}
		return true;
	}
};

int main()
{
	Solution s;
	int n=100;
	cout<<s.numPrimeArrangements(n)<<endl;
	return 0;
}
